package com.questionGenerator.controller;

import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.questionGenerator.dto.req.GeneratorReqDTO;
import com.questionGenerator.dto.resp.QuestionRespDTO;
import com.questionGenerator.service.GeneratorService;
import com.questionGenerator.vo.UnifyResponseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: usagi
 * @Date: 2024/06/26/23:41
 * @Description:
 */
@RestController
@RequestMapping("/generator/")
public class GeneratorController {
    @Autowired
    public GeneratorService generatorService;
    @PostMapping("question")
    public UnifyResponseVO<QuestionRespDTO> ExampleGenerator(@RequestBody GeneratorReqDTO generatorReqDTO) throws NoApiKeyException, InputRequiredException {
        return new UnifyResponseVO("200",generatorService.ExampleGenerator(generatorReqDTO));
    }
}
